import org.apache.lucene.index.FieldInvertState;
import org.apache.lucene.search.similarities.TFIDFSimilarity;
import org.apache.lucene.util.BytesRef;

class MyTFIDFSimilarity extends TFIDFSimilarity {

	public float tf(int frequency) {
		return (float) Math.log10(1 + frequency);
	}

	public float tf(float frequency) {
		float return_value = (float) Math.log10(1 + frequency);
		return return_value;
	}

	public float idf(long docFreq, long numDocs) {
		float return_value = 0;
		if (docFreq == 0) {
			return_value = 0;
		} else {
			double temp2 = (float) numDocs / (float) docFreq;
			double temp = Math.log10(temp2);
			return_value = (float) temp;
		}
		return return_value;
	}

	public float coord(int overlap, int maxOverlap) {
		return 1f;
	}

	public float queryNorm(float sumOfSquaredWeights) {
		return 1f/(float)Math.sqrt(sumOfSquaredWeights);
		//return 1f;
	}

	public float lengthNorm(FieldInvertState state) {
		return 1f;

	}

	public float decodeNormValue(long norm) {
		return 1f;
	}

	@Override
	public long encodeNormValue(float arg0) {
		// TODO Auto-generated method stub
		return 0l;
	}

	@Override
	public float scorePayload(int arg0, int arg1, int arg2, BytesRef arg3) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public float sloppyFreq(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

}